import { request } from 'umi';
/** 商品销售统计(700700000) */
export async function getGoodsSaleData(
  params: {
    begin_date_str?: string;
    end_date_str?: string;
    current?: number;
    pageSize?: number;
    goodsId?: string;
    goodsName?: string;
  }
) {
  return request(`/api/data/goods/from/${params.begin_date_str}/to/${params.end_date_str}/sale/${params.current}/limit/${params.pageSize}?goods_id=${params.goodsId || ''}&goods_name=${params.goodsName || ''}`, {
    method: 'GET',
    headers: {
      Action_Id: '700700000'
    },
  });
}

// 商品销售统计下载报表(700700001)
export async function downGoodsSaleData(
  params: {
    begin_date_str?: string;
    end_date_str?: string;
    goodsId?: string;
    goodsName?: string;
  }
) {
  return request(`/api/data/goods/from/${params.begin_date_str}/to/${params.end_date_str}/sale/report?goods_id=${params.goodsId || ''}&goods_name=${params.goodsName || ''}`, {
    method: 'GET',
    headers: {
      Action_Id: '700700001'
    },
  });
}

// 查询商品销售详情(700700002,700700003)
export async function getGoodsSaleDataForDetail(
  params: {
    begin_date_str?: string;
    end_date_str?: string;
    current?: number;
    pageSize?: number;
    goodsId?: string;
    goodsName?: string;
  }
) {
  return request(`/api/data/goods/from/${params.begin_date_str}/to/${params.end_date_str}/sale/${params.current}/limit/${params.pageSize}/detail?goods_id=${params.goodsId || ''}&goods_name=${params.goodsName || ''}`, {
    method: 'GET',
    headers: {
      Action_Id: '700700002'
    },
  });
}

// 查询商品销售详情-报表下载(700700004)
export async function downGoodsSaleDataForDetail(
  params: {
    begin_date_str?: string;
    end_date_str?: string;
    goodsId?: string;
    goodsName?: string;
  }
) {
  return request(`/api/data/goods/from/${params.begin_date_str}/to/${params.end_date_str}/sale/detail/report?goods_id=${params.goodsId || ''}&goods_name=${params.goodsName || ''}`, {
    method: 'GET',
    headers: {
      Action_Id: '700700004'
    },
  });
}
// 订单销售统计(700701000）
export async function getOrderSaleData(
  params: {
    start?: string;
    end?: string;
  }
) {
  return request(`/api/data/order/from/${params.start}/to/${params.end}/sale`, {
    method: 'GET',
    headers: {
      Action_Id: '700701000'
    },
  });
}

// 订单销售统计-报表下载(700701001)
export async function downOrderSaleDataForDetail(
  params: {
    start?: string;
    end?: string;
  }
) {
  return request(`/api/data/order/from/${params.start}/to/${params.end}/sale/report`, {
    method: 'GET',
    headers: {
      Action_Id: '700701001'
    },
  });
}

// 订单销售明细(700701002,700701003)
export async function getOrderSaleDataForDetail(
  params: {
    begin_date_str?: string;
    end_date_str?: string;
    current?: number;
    pageSize?: number;
    handleType?: string;
    createChannel?: string;
    order_status?: string;
  }
) {
  return request(`/api/data/order/from/${params.begin_date_str}/to/${params.end_date_str}/sale/${params.current}/limit/${params.pageSize}/detail?handle_type=${params.handleType || ''}&create_channel=${params.createChannel || ''}&order_status=${params.order_status || ''}`, {
    method: 'GET',
    headers: {
      Action_Id: '700701002'
    },
  });
}
// 订单销售明细-报表下载(700701004)
export async function downloadOrderSaleDataForDetail(
  params: {
    begin_date_str?: string;
    end_date_str?: string;
    current?: number;
    pageSize?: number;
    handleType?: string;
    createChannel?: string;
    order_status?: string;
  }
) {
  return request(`/api/data/order/from/${params.begin_date_str}/to/${params.end_date_str}/sale/detail/report?handle_type=${params.handleType || ''}&create_channel=${params.createChannel || ''}&order_status=${params.order_status || ''}`, {
    method: 'GET',
    headers: {
      Action_Id: '700701004'
    },
  });
}

// 订单结算统计(700702000)
export async function getOrderSettleDataForDetail(
  params: {
    begin_date_str?: string;
    end_date_str?: string;
    current?: number;
    pageSize?: number;
    handleType?: string;
    createChannel?: string;
    order_status?: string;
  }
) {
  return request(`/api/data/sett/from/${params.begin_date_str}/to/${params.end_date_str}/sale/${params.current}/limit/${params.pageSize}/?handle_type=${params.handleType || ''}&create_channel=${params.createChannel || ''}&order_status=${params.order_status || ''}`, {
    method: 'GET',
    headers: {
      Action_Id: '700702000'
    },
  });
}
// 订单结算统计-报表下载(700702001)
export async function downloadOrderSettleDataForDetail(
  params: {
    begin_date_str?: string;
    end_date_str?: string;
    current?: number;
    pageSize?: number;
    handleType?: string;
    createChannel?: string;
    order_status?: string;
  }
) {
  return request(`/api/data/sett/from/${params.begin_date_str}/to/${params.end_date_str}/sale/report?handle_type=${params.handleType || ''}&create_channel=${params.createChannel || ''}&order_status=${params.order_status || ''}`, {
    method: 'GET',
    headers: {
      Action_Id: '700702001'
    },
  });
}

// 供应商结算统计(700703000)
export async function getSupplierSaleData(
  params: {
    begin_date_str?: string;
    end_date_str?: string;
    current?: number;
    pageSize?: number;
    goodsId?: string;
    goodsName?: string;
    supplier?: string;
    batchId?: string;
  }
) {
  return request(`/api/data/supplier/from/${params.begin_date_str}/to/${params.end_date_str}/sale/${params.current}/limit/${params.pageSize}?goods_id=${params.goodsId || ''}&goods_name=${params.goodsName || ''}&supplier=${params.supplier || ''}&batch_id=${params.batchId || ''}`, {
    method: 'GET',
    headers: {
      Action_Id: '700703000'
    },
  });
}

// 供应商结算统计-报表下载(700703001)
export async function downSupplierSaleData(
  params: {
    begin_date_str?: string;
    end_date_str?: string;
    current?: number;
    pageSize?: number;
    goodsId?: string;
    goodsName?: string;
    supplier?: string;
    batchId?: string;
  }
) {
  return request(`/api/data/supplier/from/${params.begin_date_str}/to/${params.end_date_str}/sale/report?goods_id=${params.goodsId || ''}&goods_name=${params.goodsName || ''}&supplier=${params.supplier || ''}&batch_id=${params.batchId || ''}`, {
    method: 'GET',
    headers: {
      Action_Id: '700703001'
    },
  });
}

// 供应商结算统计 - 详情(700703002,700703003)
export async function getSupplierSaleDataForDetail(
  params: {
    begin_date_str?: string;
    end_date_str?: string;
    current?: number;
    pageSize?: number;
    goodsId?: string;
    goodsName?: string;
    supplier?: string;
    batchId?: string;
  }
) {
  return request(`/api/data/supplier/from/${params.begin_date_str}/to/${params.end_date_str}/sale/${params.current}/limit/${params.pageSize}/detail?goods_id=${params.goodsId || ''}&goods_name=${params.goodsName || ''}&supplier=${params.supplier || ''}&batch_id=${params.batchId || ''}`, {
    method: 'GET',
    headers: {
      Action_Id: '700703002'
    },
  });
}

// 供应商结算统计详情-报表下载(700703004)
export async function downSupplierSaleDataForDetail(
  params: {
    begin_date_str?: string;
    end_date_str?: string;
    current?: number;
    pageSize?: number;
    goodsId?: string;
    goodsName?: string;
    supplier?: string;
    batchId?: string;
  }
) {
  return request(`/api/data/supplier/from/${params.begin_date_str}/to/${params.end_date_str}/sale/detail/report?goods_id=${params.goodsId || ''}&goods_name=${params.goodsName || ''}&supplier=${params.supplier || ''}&batch_id=${params.batchId || ''}`, {
    method: 'GET',
    headers: {
      Action_Id: '700703004'
    },
  });
}

// 租赁情况统计(700704000)
export async function getRentSaleDataForDetail(
  params: {
    begin_date_str?: string;
    end_date_str?: string;
    current?: number;
    pageSize?: number;
    goodsName?: string;
    patientName?: string;
    admissionNum?: string;
    sumFlag?: string;
  }
) {
  return request(`/api/data/rent/from/${params.begin_date_str}/to/${params.end_date_str}/sale/${params.current}/limit/${params.pageSize}?goods_name=${params.goodsName || ''}&patient_name=${params.patientName || ''}&admission_num=${params.admissionNum || ''}&sum_flag=${params.sumFlag || ''}`, {
    method: 'GET',
    headers: {
      Action_Id: '700704000'
    },
  });
}

// 租赁结算统计详情-报表下载(700704001)
export async function downRentSaleDataForDetail(
  params: {
    begin_date_str?: string;
    end_date_str?: string;
    current?: number;
    pageSize?: number;
    goodsId?: string;
    goodsName?: string;
    supplier?: string;
    batchId?: string;
  }
) {
  return request(`/api/data/rent/from/${params.begin_date_str}/to/${params.end_date_str}/sale/report?goods_name=${params.goodsName || ''}&patient_name=${params.patientName || ''}&admission_num=${params.admissionNum || ''}&sum_flag=${params.sumFlag || ''}`, {
    method: 'GET',
    headers: {
      Action_Id: '700704001'
    },
  });
}

/** 绩效统计(700705000) */
export async function getOperateData(
  params: {
    begin_date_str?: string;
    end_date_str?: string;
    current?: number;
    pageSize?: number;
    orderType?: string;
  }
) {
  return request(`/api/data/operate/from/${params.begin_date_str}/to/${params.end_date_str}/sale/${params.current}/limit/${params.pageSize}?order_type=${params.orderType || ''}`, {
    method: 'GET',
    headers: {
      Action_Id: '700705000'
    }
  });
}

// 绩效统计(700705001)
export async function downOperateData(
  params: {
    begin_date_str?: string;
    end_date_str?: string;
    current?: number;
    pageSize?: number;
    orderType?: string;
  }
) {
  return request(`/api/data/operate/from/${params.begin_date_str}/to/${params.end_date_str}/sale/report?order_type=${params.orderType || ''}`, {
    method: 'GET',
    headers: {
      Action_Id: '700705001'
    }
  });
}


// 护工缴费情况统计(700706000)
export async function getWorkerPayData(
  params: {
    begin_date_str?: string;
    end_date_str?: string;
    current?: number;
    pageSize?: number;
    workerNo?: string;
    workerName?: string;
  }
) {
  return request(`/api/data/worker/from/${params.begin_date_str}/to/${params.end_date_str}/pay/${params.current}/limit/${params.pageSize}?worker_no=${params.workerNo || ''}&worker_name=${params.workerName || ''}`, {
    method: 'GET',
    headers: {
      Action_Id: '700706000'
    }
  });
}
// 护工缴费情况统计-报表(700706001)
export async function downWorkerPayData(
  params: {
    begin_date_str?: string;
    end_date_str?: string;
    current?: number;
    pageSize?: number;
    workerNo?: string;
    workerName?: string;
  }
) {
  return request(`/api/data/worker/from/${params.begin_date_str}/to/${params.end_date_str}/pay/report?worker_no=${params.workerNo || ''}&worker_name=${params.workerName || ''}`, {
    method: 'GET',
    headers: {
      Action_Id: '700706001'
    }
  });
}